﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using Kingdee.BOS;
using Kingdee.BOS.Contracts;
using Kingdee.BOS.Orm.DataEntity;

namespace CHR.Contract.Common
{
    /// <summary>
    /// 公共服务
    /// </summary>
    public interface ICommonService
    {
        /// <summary>
        /// 获取业务对象发布的自定义参数
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="formKey">业务对象key</param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(ServiceFault))]
        Dictionary<string, object> GetCustomParams(Context ctx, string formKey);

        /// <summary>
        /// 获取系统参数
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="orgId">当前组织</param>
        /// <param name="category">系统参数formId</param>
        /// <param name="key"></param>
        /// <param name="defvalue">自定义的默认值</param>
        /// <returns></returns>
        object GetSystemProfile(Context ctx, long orgId, string category, string key, object defvalue);

        /// <summary>
        /// 清业务数据缓存
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="formId">单据标识</param>
        /// <param name="id">单据id</param>
        void ClearCache(Context ctx, string formId, Int64 id);

        /// <summary>
        /// 清业务数据缓存(批量)
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="formId">单据标识</param>
        /// <param name="id">单据id</param>
        void ClearCache(Context ctx, string formId, List<Int64> idList);

    }
}
